<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="./css/mobile.css">
    <style>
        .defdisplay {
            display:none;
        }
        body {
            background:#f3f4f5;
        }
        #divResult{
            background:#fff;
            padding:20px 20px 10px;
        }
       .headerTit{
           white-space:normal;
           display: flex;
            align-items: center;
            justify-content: center;
           background:#fff;
           margin-bottom:10px;
           color:#222222;
           font-size:18px;
           padding:20px;
           text-align:center;
       }
       .tpchart{
       height:13px;padding:3px;background-color: #F2F2F2;position:relative;margin-top:8px;
       }
       .tppiao{
       color:#0095FF;flex: 1 0 auto;text-align: right;margin-left: 5px;
       }
       .tpchoice{
       color:#262626;float:left;font-size: 15px;font-weight: 500
       }
    </style>
    <title>投票结果 - 凤凰城小区首次业主大会</title>
</head>
<?php 
$voteUser=array(
    1=>'周培源',
    2=>'胡小燕',
    3=>'宁武华',
    4=>'王云虎',
    5=>'罗红玉',
    6=>'夏林雯',
    7=>'洪承角',
    8=>'曾玉兰',
    9=>'顾小平',
    10=>'徐冬英',
    11=>'程叶伟',
    12=>'赵平',
    13=>'邱小梅',
    14=>'周志军',
    15=>'张俐俊',
    16=>'陈建平',
    17=>'仇忠海',
    18=>'张小谦',
    19=>'吴忠英',
    20=>'周小明',
    21=>'占彩虹'
);

$piaoArr=array();
$piaoArr[1]=0;$piaoArr[2]=0;$piaoArr[3]=0;$piaoArr[4]=0;$piaoArr[5]=0;$piaoArr[6]=0;$piaoArr[7]=0;$piaoArr[8]=0;$piaoArr[9]=0;$piaoArr[10]=0;
$piaoArr[11]=0;
$piaoArr[12]=0;
$piaoArr[13]=0;
$piaoArr[14]=0;
$piaoArr[15]=0;
$piaoArr[16]=0;
$piaoArr[17]=0;
$piaoArr[18]=0;
$piaoArr[19]=0;
$piaoArr[20]=0;
$piaoArr[21]=0;
include_once("./c/config.php");
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
$sql="SELECT COUNT(uid) as count,uid FROM `piao` GROUP BY uid ";
$query=$mysqli->query($sql);
while ($list=$query->fetch_assoc()){
    $piaoArr[$list['uid']]=$list['count'];
}

$totalP=0;
foreach ($piaoArr as $v){
    $totalP+=$v;
}
 
//arsort($piaoArr);
?>
<body>
     <div class="headerTit">
       <span id="lblHeader">候选人投票</span>
    </div>
    <div style="width: 100%;margin:0 auto;">
        <div id="divResult">
        <div style="margin-bottom:15px;display:none;">
        您的答卷已经提交，感谢您的参与！
        </div>
        <div style="text-align:left;padding-bottom:10px;font-size:14px;">
        <div style="padding-bottom:30px;color:#A6A6A6;font-size:18px;font-weight: bold;line-height: 25px;" class="tptitle">选举产生业委会委员</div>
        
        <?php 
        $j=1;
        foreach ($piaoArr as $k=>$v){ 
            ?>
        <div class="tpdetial" style="padding-bottom:15px;position:relative;display: flex;justify-content: space-between;align-items: center;margin-bottom:10px;">
            <div style="width: 20px;height:22px;font-size:16px;font-weight:600;color: #BFBFBF;margin-right: 10px;text-align: center">
               <?php if ($j < 4){ ?>
               <img src="./img/v/<?php echo $j; ?>.png" width="20" height="22" style="max-width: none;" />
               <?php }else{ 
                   
                   echo $j;
               } 
               $j++;
               ?>
            </div>
            <div style="margin:0 17px 0 10px">
              <img style="width: 40px;height: 40px;border-radius: 12px;" src="./user/<?php echo $voteUser[$k]; ?>.jpg"  />
            </div>
            <div style="flex:1 1 auto;width: calc(100% - 77px)">
            <div style="display: flex;justify-content: space-between;">
            <div  class="tpchoice"><?php echo $k,'【号 】 ',$voteUser[$k]; ?></div>
            <div class="tppiao"><?php echo $v; ?>&nbsp;&nbsp;<span style="color: #262626;font-weight:600;">票</span></div></div>
            <div style="clear:both;"></div>
                <div class="tpchart">
                    <div style="width:<?php echo  round($v/$totalP,4)*100; ?>%;background:#0095FF;height: 7px; "></div>
                </div>
            </div>
        </div>
        <?php } ?>
        
       
    
    </div>
    
    </div>
    
    </div>


</body></html>